home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-list200994.lha / blitz-list / text0345.txt < prev    next >
Encoding:
Text File  |  1994-09-20  |  1.9 KB  |  54 lines

  1.  
  2. > Hi all!
  3.  
  4. > I badly need some decopression routines so I just wondered is there 
  5. > any lib extensions for blitz which contains some commands to unpack 
  6. > powerpacked data files - something like unpack (filename$,from adr,to 
  7. > adr). Thanx!
  8.  
  9. >                         O.T.T. (ott@microlnk.ml.ee)
  10.  
  11. Well you may like to try the undocumented commands "implode" and
  12. "Deplode".  there syntax is as follows:
  13.  
  14.   IMPLODE: Error/crunched
  15.   length = Implode (Buffer Address, Data Length)
  16.  
  17.   DEPLODE: Success(Buffer Address)
  18.  
  19. The Implode command requires an address in memory to start its
  20. compressions from, and the length of the data you want to pack.
  21. The screen colours will flash during the compression process to let
  22. you know it's working.  If the compression was successful, you'll
  23. be returned the new length of the imploded data, otherwise an error
  24. code.
  25.  
  26. The Deplode command only requires the address in memory that your
  27. compressed data is located at, and it will set to work
  28. uncompressing it.
  29.  
  30. The problem is, the Deplode will expand the data out to its
  31. original length regardless of your buffersize, so it is vital that
  32. you allocate enough memory to hold the uncompressed data length,
  33. not just the size of the compresses data.
  34.  
  35. Most of the time this won;t be a problem, since it will have been
  36. you that created the packed file.  Luckily, the compressed data
  37. stores the expanded length of the data in the second longword of
  38. the file, so it's possible to read this if you are unsure of the
  39. uncompressed data's length.
  40. "
  41.  
  42. The above info, was taken from The Australian Commodore and Amiga
  43. Review, May edition.
  44.  
  45. Dave
  46. -----------------------------------------------------------
  47. Dave Cole                      | Please contact me for info 
  48. s933384@yallara.cs.rmit.oz.au  | about
  49. s933384@minyos.xx.rmit.oz.au   |        The Warhammer 
  50. David_Cole@guru.apana.org.au   |         Compendium
  51. -----------------------------------------------------------
  52.  
  53.